<!DOCTYPE html>
<html lang="en">
<head>
    <script src="../js/vue.js"></script>
    <title>收集表单数据</title>
</head>
<body>
   <div id="root">
        <h2 :style='{opacity}'>分手了怎么办？</h2>
   </div>
   <script>
       new Vue({
           el:'#root',
           data:{
            opacity:0.5,
           },
           methods:{
                death(){
                    //vm还在但是不能用了，还在但是不监听了，这是销毁
                    this.$destory();
                }
           },
           //Vue实例挂载完毕
           mounted(){
                setInterval(()=>{
                    this.opacity-=0.01;
                },16);
           },
           //vm将要销毁
           beforDestory(){
                
           }
       });
   </script>
</body>
</html>